//
//  YHOptionTitleTwoBoxsPickerTableViewCell.m
//  ScriptKill
//
//  Created by 林宁宁 on 2021/4/28.
//  Copyright © 2021 优智汇. All rights reserved.
//

#import "YHOptionTitleTwoBoxsPickerTableViewCell.h"
#import "UIFont+YH.h"

@implementation YHOptionTitleTwoBoxsPickerTableViewCell

-(void)yh_optionInit{
    
    
    self.boxTextFiled1 = [YHInputTextField new];
    self.boxTextFiled1.textAlignment = NSTextAlignmentCenter;
    self.boxTextFiled1.textColor = [UIColor yh_hint];
    self.boxTextFiled1.font = [UIFont yh_pfOfSize:14];
    [self.boxTextFiled1 addLeftViewShowWidth:10 title:@""];
    [self.boxTextFiled1 addRightViewShowWidth:10 title:@""];
    self.boxTextFiled1.backgroundColor = [UIColor yh_background];
    self.boxTextFiled1.layer.cornerRadius = 2;
    self.boxTextFiled1.layer.masksToBounds = YES;
    self.boxTextFiled1.layer.borderColor = [UIColor yh_background].CGColor;
    self.boxTextFiled1.layer.borderWidth = 1;
    [self.cellOptionContentView addSubview:self.boxTextFiled1];
    [self.boxTextFiled1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.cellOptionContentView);
        make.left.equalTo(self.cellOptionContentView);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(25);
    }];
    
    
    UILabel * centerLab = [UILabel new];
    centerLab.textColor = [UIColor yh_hint];
    centerLab.font = [UIFont yh_pfOfSize:14];
    self.centerInfoLabel = centerLab;
    [self.cellOptionContentView addSubview:centerLab];
    [centerLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.cellOptionContentView);
        make.left.equalTo(self.boxTextFiled1.mas_right).offset(YHOptionLayout_Space15());
    }];
    
    self.boxTextFiled2 = [YHInputTextField new];
    self.boxTextFiled2.textAlignment = NSTextAlignmentCenter;
    self.boxTextFiled2.textColor = [UIColor yh_hint];
    self.boxTextFiled2.font = [UIFont yh_pfOfSize:14];
    [self.boxTextFiled2 addLeftViewShowWidth:10 title:@""];
    [self.boxTextFiled2 addRightViewShowWidth:10 title:@""];
    self.boxTextFiled2.backgroundColor = [UIColor yh_background];
    self.boxTextFiled2.layer.cornerRadius = 2;
    self.boxTextFiled2.layer.masksToBounds = YES;
    self.boxTextFiled2.layer.borderColor = [UIColor yh_background].CGColor;
    self.boxTextFiled2.layer.borderWidth = 1;
    [self.cellOptionContentView addSubview:self.boxTextFiled2];
    [self.boxTextFiled2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.cellOptionContentView);
        make.left.equalTo(self.centerInfoLabel.mas_right).offset(YHOptionLayout_Space15());
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(25);
    }];
}

-(void)setBoxWidth1:(CGFloat)boxWidth1{
    if(_boxWidth1 == boxWidth1){
        return;
    }
    _boxWidth1 = boxWidth1;
    [self.boxTextFiled1 mas_updateConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(boxWidth1);
    }];
}

-(void)setBoxWidth2:(CGFloat)boxWidth2{
    if(_boxWidth2 == boxWidth2){
        return;
    }
    _boxWidth2 = boxWidth2;
    [self.boxTextFiled2 mas_updateConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(boxWidth2);
    }];
}


-(void)setBoxHeight1:(CGFloat)boxHeight1{
    if(_boxHeight1 == boxHeight1){
        return;
    }
    _boxHeight1 = boxHeight1;
    [self.boxTextFiled1 mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(boxHeight1);
    }];
}

-(void)setBoxHeight2:(CGFloat)boxHeight2{
    if(_boxHeight2 == boxHeight2){
        return;
    }
    _boxHeight2 = boxHeight2;
    [self.boxTextFiled2 mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(boxHeight2);
    }];
}


@end

